package com.gszy.auth.controller;


import com.gszy.auth.entity.Product;
import com.gszy.auth.mvc.BeanFactory;
import com.gszy.auth.mvc.Controller;
import com.gszy.auth.mvc.ModelAndView;
import com.gszy.auth.mvc.RequestMapping;
import com.gszy.auth.service.ProductService;

import java.util.List;

/**
 * @author MeUChT
 */
@Controller("/product")
public class ProductController {
    private ProductService productService = BeanFactory.getInstance(ProductService.class);
    

    @RequestMapping("/list.do")
    public ModelAndView findAll(){
        List<Product> datas = productService.findAll();

        return new ModelAndView()
                .setPath("/pages/product/product-list.jsp")
                .add("productList",datas);

    }
}
